All Questions
Tagged with arrayadvanced-custom-fields
24 questions
1vote
1answer
136views
Display custom post type attached media file sizes
We have a custom post type slugged 'download' and it acts like a posts but with the different slug. (It displays content like a post). Now, We have a custom field named "videos" and ...
0votes
1answer
876views
Custom WordPress Function - Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
I've searched far and wide for a solution to the problem. I'm almost there, but can't seem to get it working completely. Background There are 3 post types that are involved in this function: League, ...
2votes
2answers
3kviews
How to write PHP array to render JSON-LD Markup for Job Postings, with ACF
i want to add a dynamic JSON-LD (schema.org) for career posts in my wordpress page. I tried this code below. But i think i have some Syntax errors within the array. Maybe the "echo" is not ...
0votes
1answer
2kviews
ACF - Get ID of relationship field in flexible content
I'm trying to get ID from a relationship field within a flexible content and push it in a array if (have_rows('studio_blocs')) { while(have_rows('studio_blocs')) { the_row(); $...
0votes
1answer
879views
Conditional multidimensional arrays and array_map
I'm using Roots Sage 9, which uses Laravel within WordPress, and am combining this with Advanced Custom Fields. For this, I have created a Controller, where I use an array_map to iterate through the ...
0votes
2answers
225views
Help using an array in 'exclude' key of another array
I want to exclude two items (using their IDs) from an array that's retrieving images attached to the post: the post's thumbnail (featured image) and an image attached via Advanced Custom Fields. I'm ...
0votes
1answer
34views
I want to place a post before all others from an ACF boleen field
I am currently trying to retrieve an post (to put it before all others in the search results of a search filter I created) from an ACF boolean field (and I am a beginner), so I made this script but I ...
0votes
0answers
150views
Convert number to date format within an array
I have a custom field of deal_date that I need to work into an array. When using directly on a template I can just set the output format directly in the ACF UI. However I obviously cant use get_field ...
2votes
0answers
85views
Can an array be used as a meta_query value?
I'm trying to query a custom post type (courses) by grade using WP_Query and Advanced Custom Fields (ACF). Grades (checkboxes) are organized by term (groups). Four grades per term, four terms per ...
1vote
2answers
2kviews
How can I add multiple 'tax_query' arrays via a loop?
I'm trying to build functionality (using the Advanced Custom Fields plugin) to list information in a page template for all custom post types ('Product') that have specified taxonomies. This is my ...
0votes
1answer
713views
Make sticky post with FacetWP
I have WordPress posts in combination with Advanced Custom Fields and FacetWP for filtering. WordPress has an option to make a post sticky, I did this and nothing happenend so I tried to change my ...
0votes
1answer
91views
Trying to select 1 item from an array
I am trying to get 1 item from an associative array that I am outputting form an ACF field. I am doing the following: print_r(get_field('consultant_name')); This is on the ACF field where I can ...
0votes
1answer
379views
Display a single row from nested array of custom field data
I built an Exercise custom post type with a custom field group using Advanced Custom Fields. The structure uses repeater fields for Week, Day, and Exercise, which creates a series of nested arrays. It ...
0votes
2answers
3kviews
Advanced Custom Fields - display label and value only if value entered
i currently have the following: <?php $field_name = "text_field"; $field = get_field_object($field_name); <table> <tbody> if( isset($field['value'] ): ?> <...
1vote
1answer
858views
Changing a specific value inside a complex repeater/flexible content field (ACF)
So I have a really complex ACF repeater / flexible content field (essentially a pagebuilder). What I want to do is get a specific sub-sub-subfield value from one post ($source_post) and insert it in ...